package cn.demoncat.util.lang.entity;

import java.io.Serializable;
import java.util.Objects;

/**
 * 
 * 
 * 描述：{字符串,数值}键值对类型的实体类
 *
 * @author yxl
 *
 * @version 2.0
 *
 * @since 2016-12-9
 */
public class StrInteger implements Serializable {

	private static final long serialVersionUID = 1L;
	
	// 字符串类型的键
	private String str;
	// 数值类型的值
	private Integer num;

	public StrInteger() {
		super();
	}

	public StrInteger(String str, Integer num) {
		super();
		this.str = str;
		this.num = num;
	}

	public String getStr() {
		return str;
	}

	public void setStr(String str) {
		this.str = str;
	}

	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}

	@Override
	public String toString() {
		return "StrLong [str=" + str + ", num=" + num + "]";
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		StrInteger that = (StrInteger) o;
		return Objects.equals(str, that.str) &&
				Objects.equals(num, that.num);
	}

	@Override
	public int hashCode() {
		return Objects.hash(str, num);
	}
}
